/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

/**
 * <p>Project: jse2303 - T5</p>
 * <p>Powered by webrx On 2023-07-26 16:59:07</p>
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class T5 {
    public static void main(String[] args) {
        var t = new T5();
        var t1 = new Thread(t::worker, "A");
        //t1.setPriority(Thread.MIN_PRIORITY);
        t1.setPriority(Thread.MAX_PRIORITY);
        //t1.setPriority(Thread.NORM_PRIORITY);
        //t1.setPriority(100);
        t1.setName("TTTT");
        var t2 = new Thread(t::worker, "B");
        var t3 = new Thread(t::worker, "C");
        t2.start();
        t1.start();
        t3.start();
        Thread.currentThread().setName("主线程");
        String tn = Thread.currentThread().getName();
        System.out.println(Thread.currentThread().getPriority());
        System.out.println(tn);
        System.out.println(Thread.activeCount());
    }

    void worker() {
        String t = Thread.currentThread().getName();
        System.out.println(t);
    }
}
